<template>
    <div>
        我是a组件
        <!-- {{$store.state.arr}} -->
        <span>{{$store.state.name}}</span>
        <button @click="setName">修改仓库得name属性</button>
        <h4>{{$store.state.num}}</h4>
        <button @click="setNum">修改num</button>
        <h4>
            {{$store.getters.bignum}}
        </h4>
    </div>
</template>

<script>
export default {
    methods:{
        setName(){
            this.$store.commit("setName1","王五")
        },
        setNum(){
            this.$store.commit("setNum",20)
        }
    },
    mounted() {
         this.$store.dispatch("getList")
    }
}
</script>

<style>

</style>